<!--
/**
 * 系统配置 列表页 JS 脚本
 * @author 李方捷 , leefangjie@qq.com
 * @since 2021-09-09 19:29:41
 * @version
 */
 -->
 <!DOCTYPE html>
<html style="background-color: #FFFFFF;">

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8"/>
	<title th:text="${lang.translate('系统配置')}">系统配置</title>
    <link th:if(theme.ico!="null") rel="shortcut icon" th:href="${theme.ico}" type="image/vnd.microsoft.icon">
    <link th:if(theme.ico!="null") rel="icon" th:href="theme.ico" type="image/vnd.microsoft.icon">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/assets/libs/layui/css/layui.css" th:href="'/assets/libs/layui/css/layui.css?'+${cacheKey}"/>
    <link rel="stylesheet" href="/assets/css/admin.css" th:href="'/assets/css/admin.css?'+${cacheKey}"/>
    <link rel="stylesheet" href="/assets/libs/toast/css/toast.css" type="text/css" th:href="'/assets/libs/toast/css/toast.css?'+${cacheKey}">
    <link rel="stylesheet" href="/assets/css/foxnic-web.css" th:href="'/assets/css/foxnic-web.css?'+${cacheKey}"/>
    <link href="/assets/libs/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="/assets/libs/material-design-webfont/css/material-design-icons-min.css" rel="stylesheet">
    <script th:inline="javascript">var foxnic_cachekey=[[${cacheKey}]];</script>
    <style>
        .layui-form-label-c1 {
            width: 80px;
        }
        .layui-input-block-c1 {
            margin-left: 115px;
        }
    </style>
	<link th:each="css:${theme.css}" rel="stylesheet" th:href="${css}+'?'+${cacheKey}">
</head>

<body style="overflow-y: hidden;">
<div class="form-container" >

    <form id="data-form" lay-filter="data-form" class="layui-form model-form" style="display:none">
        <input name="id" id="id"  type="hidden"/>
        <input name="profileId" id="profileId"  type="hidden"/>
        <input name="code" id="code"  type="hidden"/>


         <!--开始：group 循环-->



        <div class="layui-row form-row">

             <!--开始：group 循环-->
            <div class="layui-col-xs12 form-column">

                    <div class="layui-form-item" style="display: none">
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('配置键')}">配置键</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input lay-filter="code" id="code" name="code" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('配置键') }" type="text" class="layui-input"  />
                        </div>
                    </div>

                                    <div class="layui-form-item" >
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('配置名')}">配置名</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input lay-filter="name" id="name" name="name" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('配置名') }" type="text" class="layui-input"  />
                        </div>
                    </div>


                <div class="layui-form-item" >
                    <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('数据类型')}">数据类型</div></div>
                    <div class="layui-input-block layui-input-block-c1">
                        <input input-type="radio" type="radio" name="type" lay-filter="type" th:each="e,stat:${enum.toArray('org.github.foxnic.web.constants.enums.system.SystemConfigType')}" th:value="${e.code}" th:title="${e.text}" th:checked="${(e.code=='' || stat.index==-1)?'yes':'no'}">
                    </div>
                </div>


                <div class="layui-form-item" >
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('类型描述')}">类型描述</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input lay-filter="typeDesc" id="typeDesc" name="typeDesc" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('类型描述') }" type="text" class="layui-input"  />
                        </div>
                </div>

               <div class="layui-form-item" >
                    <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('配置值')}">配置值</div></div>
                    <div class="layui-input-block layui-input-block-c1">
                    <div th:if="${config}!=null">
                        <input th:if="${config.type}=='DATETIME'" type="text" name="value" id="value" lay-verify="value" th:placeholder="${ lang.translate('请选择') +''+ lang.translate('日期') }" autocomplete="off" class="layui-input" tag="date">
                        <input th:if="${config.type}=='STRING'"  lay-filter="value" id="value" name="value" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('配置值') }" type="text" class="layui-input"    />
                        <input th:if="${config.type}=='NUMBER'"  lay-filter="value" id="value" name="value" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('配置值') }" type="text"  class="layui-input" lay-verify="number" />
                        <input th:if="${config.type}=='ENUM'"  type="radio" name="value" lay-filter="value" id="value" th:each="e,stat:${enum.toArray(config.typeDesc)}" th:value="${e.code}" th:title="${e.text}">
                    </div>
                    <div th:if="${config}==null">
                        <input  lay-filter="value" id="value" name="value" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('配置值') }" type="text" class="layui-input"    />
                    </div>
                    </div>
                </div>


                <div class="layui-form-item" >
                    <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('是否生效')}">是否生效</div><div class="layui-required">*</div></div>
                    <div class="layui-input-block layui-input-block-c1">
                        <input input-type="switch" type="checkbox" id="valid"  name="valid" lay-skin="switch" lay-filter="valid" lay-text="有效|无效&nbsp;" value="1" >
                    </div>
                </div>



                    <div class="layui-form-item" >
                    <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('说明')}">说明</div></div>
                    <div class="layui-input-block layui-input-block-c1">
                        <textarea lay-filter="notes" id="notes" name="notes" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('说明') }" class="layui-textarea" style="height: 120px" ></textarea>
                    </div>
                </div>


                                    <div class="layui-form-item" style="display: none">
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('创建人ID')}">创建人ID</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input lay-filter="createBy" id="createBy" name="createBy" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('创建人ID') }" type="text" class="layui-input"  />
                        </div>
                    </div>


                    <div class="layui-form-item" style="display: none">
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('创建时间')}">创建时间</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input input-type="date" lay-filter="createTime" id="createTime" name="createTime"  autocomplete="off"  readonly  th:placeholder="${ lang.translate('请选择') +''+ lang.translate('创建时间') }" type="text" class="layui-input"   />
                        </div>
                    </div>

                                    <div class="layui-form-item" style="display: none">
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('修改人ID')}">修改人ID</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input lay-filter="updateBy" id="updateBy" name="updateBy" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('修改人ID') }" type="text" class="layui-input"  />
                        </div>
                    </div>


                    <div class="layui-form-item" style="display: none">
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('修改时间')}">修改时间</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input input-type="date" lay-filter="updateTime" id="updateTime" name="updateTime"  autocomplete="off"  readonly  th:placeholder="${ lang.translate('请选择') +''+ lang.translate('修改时间') }" type="text" class="layui-input"   />
                        </div>
                    </div>


                    <div class="layui-form-item" style="display: none">
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('是否已删除')}">是否已删除</div><div class="layui-required">*</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input lay-filter="deleted" id="deleted" name="deleted" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('是否已删除') }" type="text" class="layui-input"    lay-verify="|required"   autocomplete="off" input-type="number_input" integer="true" decimal="false" allow-negative="true" step="1.0"   scale="0" />
                        </div>
                    </div>


                                    <div class="layui-form-item" style="display: none">
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('删除人ID')}">删除人ID</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input lay-filter="deleteBy" id="deleteBy" name="deleteBy" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('删除人ID') }" type="text" class="layui-input"  />
                        </div>
                    </div>


                    <div class="layui-form-item" style="display: none">
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('删除时间')}">删除时间</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input input-type="date" lay-filter="deleteTime" id="deleteTime" name="deleteTime"  autocomplete="off"  readonly  th:placeholder="${ lang.translate('请选择') +''+ lang.translate('删除时间') }" type="text" class="layui-input"   />
                        </div>
                    </div>


                    <div class="layui-form-item" style="display: none">
                        <div class="layui-form-label layui-form-label-c1"><div th:text="${lang.translate('数据版本号')}">数据版本号</div><div class="layui-required">*</div></div>
                        <div class="layui-input-block layui-input-block-c1">
                            <input lay-filter="version" id="version" name="version" th:placeholder="${ lang.translate('请输入') +''+ lang.translate('数据版本号') }" type="text" class="layui-input"    lay-verify="|required"   autocomplete="off" input-type="number_input" integer="true" decimal="false" allow-negative="true" step="1.0"   scale="0" />
                        </div>
                    </div>


                <!--结束：栏次内字段循环-->
            </div>
            <!--结束：栏次输入框循环-->
        </div>
        <!--结束：group循环-->

        <div style="height: 8px"></div>


    </form>

</div>
<div class="model-form-footer">
    <button class="layui-btn layui-btn-primary" id="cancel-button" lay-filter="cancel-button" type="button" th:text="${lang.translate('取消')}" >取消</button>
    <button th:if="${perm.checkAnyAuth('sys_config:create','sys_config:update','sys_config:save')}" class="layui-btn" style="margin-right: 15px;display: none;"  id="submit-button" lay-filter="submit-button" lay-submit th:text="${lang.translate('保存')}">保存</button>
</div>

<script type="text/javascript" src="/module/global.js" th:src="'/module/global.js?'+${cacheKey}"></script>
<script type="text/javascript" src="/assets/libs/jquery-3.2.1.min.js" th:src="'/assets/libs/jquery-3.2.1.min.js?'+${cacheKey}"></script>
<script type="text/javascript" src="/assets/libs/pandyle.min.js" th:src="'/assets/libs/pandyle.min.js?'+${cacheKey}"></script>
<script type="text/javascript" src="/assets/libs/layui/layui.js" th:src="'/assets/libs/layui/layui.js?'+${cacheKey}"></script>
<script type="text/javascript" src="/assets/libs/toast/js/toast.js" th:src="'/assets/libs/toast/js/toast.js?'+${cacheKey}"></script>

<script th:inline="javascript">
    var LAYUI_TABLE_WIDTH_CONFIG = [[${layuiTableWidthConfig}]];
    var SELECT_CATALOGCODE_DATA = [[${dict.toArray('sys_config_catalog')}]];
    var RADIO_TYPE_DATA = [[${enum.toArray('org.github.foxnic.web.constants.enums.system.SystemConfigType')}]];
    var VALIDATE_CONFIG={"valid":{"labelInForm":"是否生效","inputType":"logic_switch","required":true}};
    var AUTH_PREFIX="sys_config";


</script>



<script th:src="'/business/system/config/config_ext.js?'+${cacheKey}"></script>
<script th:src="'/business/system/config/config_form.js?'+${cacheKey}"></script>

</body>
</html>
